<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright (c) 2009 Mitch Amiano (Mitch.C.Amiano@AgileMarkup.com)
    
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:
    
    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.
    
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.
-->

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:svg="http://www.w3.org/2000/svg"
    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    exclude-result-prefixes="xlink msxsl exsl inkscape sodipodi svg am xhtml" 
    xmlns:exsl="http://exslt.org/common"
    xmlns:am="http://www.agilemarkup.com/2009/xmlintegration"
    xmlns:amd="http://www.agilemarkup.com/2009/xmlintegration"
    extension-element-prefixes="exsl amd"
    >
    
    <amd:purpose>This stylesheet module provides the CSS, JavaScript, and HTML which together
        provide the JQuery implementation of an Atramentum designed skin. It is meant to be imported
        by the atramentum.xsl module. 
        You can think of this file as an implementation of an abstract interface:
        jquery_css   output CSS 2.1+ compliant style rules; note this has to do with the JQuery effects, not static design
        jquery_init   output JavaScript code to initialize library objects for each skinned widget
        jquery_content   output HTML code to declare document objects used as  resources for each skinned widget
    </amd:purpose>
 
 <xsl:template name="jquery_css" >
       /* insert css styles here */ 
 </xsl:template>

 <!-- include support for JQuery UI, animations and AJAX -->
 <xsl:template name="jquery_init" >     
         <link type="text/css" href="jquery/css/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />	
         <script type="text/javascript" src="jquery/js/jquery-1.3.2.min.js" ><![CDATA[ // ]]></script>
         <script type="text/javascript" src="jquery/js/jquery-ui-1.7.2.custom.min.js"><![CDATA[ // ]]></script>
         
         <script type="text/javascript">
             $(function() {
             
             <xsl:for-each select="//*/@id[contains(.,'draggable')]">
                 <xsl:text>$("#</xsl:text><xsl:value-of select="."/><xsl:text>").draggable();&#xA;</xsl:text>
             </xsl:for-each>
             
             // Accordion
             $("#accordion").accordion({ header: "h3" });
             
             // Tabs
             $('#tabs').tabs();
             
             
             // Dialog			
             $('#dialog').dialog({
             autoOpen: false,
             width: 600,
             buttons: {
             "Ok": function() { 
             $(this).dialog("close"); 
             }, 
             "Cancel": function() { 
             $(this).dialog("close"); 
             } 
             }
             });
             
             // Dialog Link
             $('#dialog_link').click(function(){
             $('#dialog').dialog('open');
             return false;
             });
             
             // Datepicker
             $('#datepicker').datepicker({
             inline: true
             });
             
             // Slider
             $('#slider').slider({
             range: true,
             values: [17, 67]
             });
             
             // Progressbar
             $("#progressbar").progressbar({
             value: 20 
             });
             
             //hover states on the static widgets
             $('#dialog_link, ul#icons li').hover(
             function() { $(this).addClass('ui-state-hover'); }, 
             function() { $(this).removeClass('ui-state-hover'); }
             );
             
             });
         </script>
  </xsl:template>
    
  <xsl:template name="jquery_content" >
  </xsl:template>
    
</xsl:stylesheet>
